cmake_minimum_required(VERSION 3.2.0)
project(feature_track)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -march=native")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread -Wno-sign-compare -Wno-unused-function -Wno-int-in-bool-context")
set(CMAKE_INSTALL_PREFIX "..")


#find_package(OpenMP REQUIRED)
find_package(OpenCV REQUIRED QUIET)
find_package(gflags 2.2.0 REQUIRED)
find_package(Ceres 2.0.0 REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR} /usr/local/include )
find_package(ZLIB REQUIRED)

# include directories
include_directories(
    ${PROJECT_SOURCE_DIR}/include
    ${OpenCV_INCLUDE_DIRS}
    ${CERES_INCLUDE_DIRS}
)

file(GLOB_RECURSE SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c*")

add_executable(run_feature_track ${SRC_FILES})
target_link_libraries(run_feature_track
  boost_filesystem
  boost_system
  ${OpenCV_LIBRARIES}
 # ${OpenMP_CXX_FLAGS}
  ${Boost_LIBRARIES}
  ${CERES_LIBRARIES}
)
